home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 3.8 KB | 150 lines | [TEXT/MPS ] |
- //----------------------------------------------------------------------------------------
- // UMyMyODPartView.cp
- // Copyright © 1996 by Apple Computer, Inc. All rights reserved.
- //----------------------------------------------------------------------------------------
-
- #ifndef __UMyODPartView__
- #include "UMyODPartView.h"
- #endif
-
- #ifndef __UODPARTVIEW__
- #include "UODPartView.h"
- #endif
-
- #ifndef __UINSERTPARTCOMMAND__
- #include "UInsertPartCommand.h"
- #endif
-
- #ifndef __UContainerDocument__
- #include "UContainerDocument.h"
- #endif
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
- // ANSI
-
- #ifndef __LIMITS__
- #include <limits.h>
- #endif
-
- // MacApp
-
- #ifndef __UMACAPPGLOBALS__
- #include "UMacAppGlobals.h"
- #endif
-
- #ifndef __UCOREGLOBALS__
- #include "UCoreGlobals.h"
- #endif
-
- #ifndef __UVIEW__
- #include "UView.h"
- #endif
-
-
- //========================================================================================
- // CLASS TMyODPartView
- //========================================================================================
- #undef Inherited
- #define Inherited TODPartView
-
- #pragma segment ASelCommand
- MA_DEFINE_CLASS_M1(TMyODPartView, Inherited);
-
- //----------------------------------------------------------------------------------------
- // Constructor
- //----------------------------------------------------------------------------------------
- #pragma segment ARes
-
- TMyODPartView::TMyODPartView()
- {
-
- }
-
- //----------------------------------------------------------------------------------------
- // Destructor
- //----------------------------------------------------------------------------------------
- #pragma segment MADestructorRes
-
- TMyODPartView::~TMyODPartView()
- {
-
- }
-
- //----------------------------------------------------------------------------------------
- // TMyODPartView::IODPartShape
- //----------------------------------------------------------------------------------------
- #pragma segment ARes
-
- void TMyODPartView::IMyODPartView(TDocument* itsDocument,
- TView* itsSuperView,
- const VPoint& itsLocation,
- const VPoint& itsSize,
- SizeDeterminer itsHSizeDet,
- SizeDeterminer itsVSizeDet,
- CAFrameRef frameRef)
- {
- this->IODPartView(itsDocument,itsSuperView,itsLocation,
- itsSize,itsHSizeDet,itsVSizeDet,frameRef);
- }
-
- //----------------------------------------------------------------------------------------
- // TMyODPartView::Draw
- //----------------------------------------------------------------------------------------
- #pragma segment ARes
-
- void TMyODPartView::Draw(const VRect& area)
- {
- TODPartView::Draw(area);
- }
-
- //----------------------------------------------------------------------------------------
- // TMyODPartView::AquirePartFromDocument(CADocumentRef sourceDocument)
- //----------------------------------------------------------------------------------------
- #pragma segment Main
-
- void TMyODPartView::AquirePartFromDocument(CADocumentRef sourceDocument)
- {
- //get the part
- TODPartView::AquirePartFromDocument(sourceDocument);
-
- CADocumentRef destDocument = fDocument->GetContainer();
-
- //•••Crappy code is just for the DEMO!!!
- //•••How FAST can I pop this out??? ;->
-
- TContainerDocument* theDocument = MA_DYNAMIC_CAST(TContainerDocument,this->fDocument);
-
-
- if(theDocument)
- {
- if(theDocument->fFrameRadioButton->IsOn())
- {
- this->SizePartToView();
-
- }
- else if(theDocument->fViewRadioButton->IsOn())
- {
- this->SizeViewToPart();
- }
- }
- }
-
- //----------------------------------------------------------------------------------------
- // InitUMyODPartView:
- //----------------------------------------------------------------------------------------
- #pragma segment DlgInit
-
- void InitUMyODPartView()
- {
- MA_REGISTER_CLASS(TMyODPartView);
- }
-
-
- //----------------------------------------------------------------------------------------
- // End of UMyODPartView.cp
-
- #pragma segment Inline
-